import request from '@/utils/request'

// 获取所有角色列表
// data: {page, pagesize}
export const getRoles = (params) => request.get('/sys/role', { params })

// 根据id获取角色详情
export const getRolesDetail = id => request.get(`/sys/role/${id}`)

// 增加角色 data: {name, region}
export const addRoles = (data) => request.post('/sys/role', data)

// 删除角色
export const delRoles = (id) => request.delete(`/sys/role/${id}`)

// 修改角色信息 data: {companyId, description, id, name, permIds}
export const editRoles = (data) => request.put(`/sys/role/${data.id}`, data)

// 给角色分配权限 data: {id, permIds}
export const assignPrem = (data) => request.put('/sys/role/assignPrem', data)
